package com.kkwrite.regimen.common.constant;

/**
 * Created by lisha on 2018/7/12 15:16.
 *
 * @author lisha
 */
public enum UserTypeEnum {
    /**
     * 普通用户类别
     */
    TYPE_NORMAL("普通用户", 1);

    private String typeName;
    private Integer typeValue;

    UserTypeEnum(String typeName, Integer typeValue) {
        this.typeName = typeName;
        this.typeValue = typeValue;
    }

    public String getTypeName() {
        return this.typeName;
    }

    public Integer getTypeValue() {
        return this.typeValue;
    }

    public static String findTypeName(int value) {
        for (UserTypeEnum typeEnum : UserTypeEnum.values()) {
            if (typeEnum.getTypeValue() == value) {
                return typeEnum.getTypeName();
            }
        }
        return UserTypeEnum.TYPE_NORMAL.getTypeName();
    }

}
